#include <stdlib.h>

static volatile unsigned int rand_seed = 1;
void srand(unsigned int seed) {
    rand_seed = seed;
}
int rand() {
    rand_seed = (rand_seed * 1103515245 + 12345) & 0x7FFFFFFF;
    return rand_seed;
}